import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material.OutlinedButton
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kotlin.demo.helper.DialogHelper

/**
 * 导出多语言
 */
@Composable
internal fun exportExcelDialog() {
    var translateKey by remember { mutableStateOf("") }//翻译res路径
    Column(
        horizontalAlignment = Alignment.CenterHorizontally,
        modifier = Modifier.padding(all = 18.dp),
    ) {
        Text(
            text = "导出多语言", style = TextStyle(fontSize = 14.sp), modifier = Modifier.padding(bottom = 10.dp)
        )
        Row(
            modifier = Modifier.background(Color.Green),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Box(modifier = Modifier.width(80.dp)) {
                Text(
                    text = "项目名称", style = TextStyle(fontSize = 14.sp), modifier = Modifier.padding(bottom = 10.dp)
                )
            }
            OutlinedTextField(
                value = translateKey,
                onValueChange = { translateKey = it },
                label = { Text("请输入项目名称", style = TextStyle(fontSize = 14.sp)) },
                placeholder = { Text("请输入项目名称", style = TextStyle(fontSize = 14.sp)) },
                textStyle = TextStyle(
                    fontSize = 14.sp, color = Color.Black
                ),
                modifier = Modifier.width(280.dp).height(60.dp).padding(0.dp) // 使 TextField 填满其父组件的宽度
            )
        }
        Spacer(modifier = Modifier.height(8.dp))
        Row(verticalAlignment = Alignment.CenterVertically) {
            Box(modifier = Modifier.width(80.dp)) {
                Text(
                    text = "项目路径", style = TextStyle(fontSize = 14.sp), modifier = Modifier.padding(bottom = 10.dp)
                )
            }
            OutlinedTextField(
                value = translateKey,
                onValueChange = { translateKey = it },
                placeholder = { Text("请输入项目路径", style = TextStyle(fontSize = 14.sp)) },
                textStyle = TextStyle(
                    fontSize = 14.sp, color = Color.Black
                ),
                modifier = Modifier.width(280.dp).height(60.dp).padding(0.dp) // 使 TextField 填满其父组件的宽度
            )
        }
        Spacer(modifier = Modifier.height(8.dp))
        Row(verticalAlignment = Alignment.CenterVertically) {
            Box(modifier = Modifier.width(80.dp)) {
                Text(
                    text = "故障码路径",
                    style = TextStyle(fontSize = 14.sp),
                    modifier = Modifier.padding(bottom = 10.dp)
                )
            }

            OutlinedTextField(
                value = translateKey,
                onValueChange = { translateKey = it },
                placeholder = { Text("请选择故障码文件", style = TextStyle(fontSize = 14.sp)) },
                textStyle = TextStyle(
                    fontSize = 14.sp, color = Color.Black
                ),
                modifier = Modifier.width(280.dp).height(60.dp).padding(0.dp) // 使 TextField 填满其父组件的宽度
            )
        }

        Row {
            OutlinedButton(
                onClick = {
                },
                content = { Text("导出", style = TextStyle(fontSize = 14.sp)) },
            )
            OutlinedButton(
                onClick = {
                    DialogHelper.dismissDialog()
                },
                content = { Text("取消", style = TextStyle(fontSize = 14.sp)) },
                modifier = Modifier.padding(start = 8.dp)
            )
        }
    }
}
